file_copy

This function copies a given file.

bool file_copy(string source, string destination, bool overwrite)

Parameters:
source
The name of the file to copy.
destination
The name of the file to copy to.
overwrite
A boolean specifying whether the source file should be overwritten (see remarks).

Return value:
true on success, false on failure.

Remarks:
Situations in which this function may return false could include:

A file copied with this function inherits all the attributes of the source file.

This function works with both absolute and relative paths.

Example:
// Copy the file C:\test.txt.

void main()
{
if(file_copy("C:\\test.txt", "c:\\test_copy.txt", false))
{
alert("Information", "The file was copied successfully.");
}
else
{
alert("Error", "The file could not be copied.\nReason: " + get_last_error_text());
}
}